package com.ruoyi.service;

import com.ruoyi.domain.AdvInoutstock;
import com.ruoyi.domain.AdvOrders;
import com.ruoyi.domain.AdvOrdersdetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Service接口
 *
 * @author ruoyi
 * @date 2024-05-13
 */
public interface IAdvOrdersService
{
    /**
     * 查询
     *
     * @param advOrdersId 主键
     * @return
     */
    public AdvOrders selectAdvOrdersByAdvOrdersId(Long advOrdersId);

    /**
     * 查询列表
     *
     * @param advOrders
     * @return 集合
     */
    public List<AdvOrders> selectAdvOrdersList(AdvOrders advOrders);

    /**
     * 新增
     *
     * @param advOrders
     * @return 结果
     */
    public int insertAdvOrders(AdvOrders advOrders);

    int choseGive(Long advOrdersId,  Long advProductId);

    public int insertAdvOrdersApp(AdvOrders advOrders);

    /**
     * 修改
     *
     * @param advOrders
     * @return 结果
     */
    public int updateAdvOrders(AdvOrders advOrders);

    /**
     * 批量删除
     *
     * @param advOrdersIds 需要删除的主键集合
     * @return 结果
     */
    public int deleteAdvOrdersByAdvOrdersIds(Long[] advOrdersIds);

    /**
     * 删除信息
     *
     * @param advOrdersId 主键
     * @return 结果
     */
    public int deleteAdvOrdersByAdvOrdersId(Long advOrdersId);

    AdvOrders selectAdvOrdersByAdvMembersId(Long advMembersId, int productType);

    AdvOrders getGive(Long advMembersId, int productType);

    /**
     * 发货操作
     * 更改订单状态 以及添加物流公司 物流单号
     * @param advOrders
     */
    int updateBySendGoods(AdvOrders advOrders);

    /**
     * 查找此id出入库记录条数和订单明细是否相等
     * @param advOrdersId
     * @return
     */
    boolean selectOutInCount(Long advOrdersId);

    /**
     * 获取出库数组
     * @param advOrdersdetail
     * @return
     */
    Map<String,Object> queryDeviceNoByProductId(AdvOrdersdetail advOrdersdetail);

    /**
     * 出库操作
     * @param advInoutstock
     */
    void exeOutGoods(AdvInoutstock advInoutstock);

    boolean isGet(String advOrdersId);

    /**
     *   小程序订单查询
     */
    List<AdvOrders> selectAllByAppOrderList(AdvOrders advOrders);



    /**
     * 小程序申请退款
     */
    void exeRequestOrderRefund(AdvOrders advOrders);

    /**
     * 退换货
     * @param advOrders
     */
    void exeGoodsChange(AdvOrders advOrders);

    /**
     * 小程序退换货申请
     * @param advOrders
     * @return
     */
    boolean goodsChangeRequest(AdvOrders advOrders);

    /**
     * 通过 id查询Order
     * @param advOrdersId
     * @return
     */
    AdvOrders selectOrderPayByOrderId(@Param("advOrdersId") Long advOrdersId);

    /**
     * 更新订单
     * @param advOrders
     */
    void updateOrdersNum(List<AdvOrders> advOrders);


    int cancelChoseGive(Long advOrdersId, Long advProductId);
}
